package com.xbongbong.admin.model;

import com.xbongbong.admin.domain.entity.PaasLabelEntity;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;

import java.util.List;
import java.util.Map;

/**
 * 应用标签
 * @author xingxing.xiao
 * @date 2020/01/09 15:11
 */
public interface PaasLabelModel extends IModel<PaasLabelEntity> {

    /**
     * 查询列表
     * @author xingxing.xiao
     * @date 2020/01/09 11:16
     */
    @Override
    List<PaasLabelEntity> findEntitys(Map<String, Object> param);

    /**
     * 查询某类型下最大的排序
     * @param type
     * @return
     */
    Integer getMaxSortByType(Integer type);

    /**
     * 通过id找到对应标签
     * @param id
     * @return
     * @throws XbbException
     */
    PaasLabelEntity getByKey(Long id) throws XbbException;

    /**
     * 保存标签
     * @param labelEntity
     * @return
     * @throws XbbException
     */
    long save(PaasLabelEntity labelEntity) throws XbbException;

    /**
     * 获取标签名
     * @param typeList
     * @return
     * @throws XbbException
     */
    List<PaasLabelEntity> getNameList(List<Integer> typeList);

    /**
     * 通过标签名获取标签
     * @param name
     * @return java.util.List<com.xbongbong.admin.domain.entity.PaasLabelEntity>
     * @author 石安
     * @date 2020-02-26
     */
    List<PaasLabelEntity> getByName(String name);

    /**
     * 批量更新标签
     * @param labelList
     * @return int
     * @author 石安
     * @date 2020-02-28
     */
    int batchUpdate(List<PaasLabelEntity> labelList);
}
